{include file="public/header" /}
<link rel="stylesheet" href="/static/admin/css/base.css" media="all">

<body>

<div class="layui-fluid layui-anim-fadein">
	<div class="layui-card">

		<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">

			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">


					<div class="layui-card-body">
						<div>
							<div class="layui-btn-container">
<!--								<a class="layui-btn layui-btn-normal layui-btn-sm" onclick="zhiju_show('添加','{:url(\'edit\',[\'id\'=>0])}',700,800)">-->
<!--									<i class="layui-icon layui-icon-add-circle-fine"></i>新增-->
<!--								</a>-->
								<a class="layui-btn layui-btn-sm" style="background: #17a2b8" onclick="openAllCate($(this));">
									<i class="layui-icon layui-icon-util"></i><span class="show_text">展开</span>
								</a>
							</div>
						</div>
						<table class="layui-table layui-form" id="table" lay-size="sm">
							<thead>
							<tr>
								<!--					<th width="20px" ><input type="checkbox" lay-filter="list_all" lay-skin="primary"/></th>-->
								<th>分类名称</th>
								<th>图标</th>
								<th>添加时间</th>
								<th>修改时间</th>
								<th width="80px">排序</th>
								<th width="80px">状态</th>
								<th width="220px;">操作</th>
							</thead>
							<tbody>
							{foreach name="list" id="v"}
							<?php if($v['pid'] == 0){ $ppid = $v['id']; } ?>
							<tr cate-id='{$v.id}' fid='{$v.pid}' level="{if $v.pid <= 0}0{else}{$v.lvl}{/if}" class="{if $v.lvl>1}layui-anim layui-anim-up layui-anim-downbit showAll{/if}" {if $v.lvl>1}style="display: none" {/if}>
								<!--					<td><input type="checkbox" lay-filter="list_checkbox" lay-skin="primary" value="{$v.id}"/></td>-->
								<td>
									{if $v.left_px > 0}
									<span style="padding-left: {$v.left_px}px;"></span>
									{if $v.lvl <= 2}<i class="layui-icon x-show" status='true'>&#xe623;</i>{/if}|— {$v.title}
									{else}
									<i class="layui-icon x-show" status='true'>&#xe623;</i>
									{$v.title}
									{/if}
								</td>
								<td><a href="{$v.icon}" target="_blank"><img src="{$v.icon}" style="width: 40px;"/></a></td>
								<td>{$v.create_time}</td>
								<td>{$v.update_time}</td>
								<td><input type="text" data-key="sort" data-id="{$v.id}" data-url="{:url('update',['key'=>'sort','id'=>$v.id])}" value="{$v.sort}" class="layui-input tableInput"/></td>
								<td class="td-status" style="text-align: center;">
									<input type="checkbox" lay-text="显示|隐藏" {if $v.status=='1'}checked{/if} lay-skin="switch" lay-filter="switch" url="{:url('update',['key'=>'status','id'=>$v.id])}"/>
								</td>
								<td class="td-manage">
									<div class="layui-btn-group">
										<button class="layui-btn layui-btn-sm right_button" onclick="zhiju_show('编辑','{:url(\'edit\',[\'id\'=>$v.id,\'pid\'=>$v.pid])}',700,800)">编辑</button>
										{if $v.lvl <= 2}
										<button class="layui-btn layui-btn-normal layui-btn-sm right_button" onclick="zhiju_show('添加子分类','{:url(\'edit\',[\'id\'=>0,\'pid\'=>$v.id])}',700,800)">添加子分类</button>
										{/if}
										{if $v.lvl > 1 && $v.id != 21}
										<button class="layui-btn-danger layui-btn layui-btn-sm right_button" onclick="destroys(this,'{:url(\'update\',[\'id\'=>$v.id,\'key\'=>\'is_del\',\'val\'=>1])}')">删除</button>
										{/if}
									</div>
								</td>
							</tr>
							{/foreach}
							</tbody>
						</table>

					</div>
				</div>

			</div>
		</div>
	</div>
</div>

</body>
{include file="public/footer" /}
</html>